In answer to my original question i did something like this
onUrlChanged: {
console.log(searchwebview.url);
test_json();
}
and i made this function to parse the returned JSON ( this function is not perfect yet )
function test_json()
{
var p_url = searchwebview.url
var http = new XMLHttpRequest();
var json , parse , text , rev_id;
http.onreadystatechange = function(){
if(http.readyState == 4 && http.status == 200)
{ json = http.responseText;
parse = JSON.parse(json);
rev_id = parse.parse.revid;
console.log(rev_id);
text = parse.parse.text["*"];
//console.log(text);
// <-- STRIP ME (o.O)
while(text.match(/'\/index.php/)){
text = text.replace(/'\/index.php/, "http://en.wikitolearn.org/index.php");
text = text.replace(/&/,"&");
text = text.replace(/MathShowImage&/, "MathShowImage&")
text = text.replace(/mode=mathml'/, "mode=mathml\"");
text = text.replace(/<meta class="mwe-math-fallback-image-inline" aria-hidden="true" style="background-image: url\(/ ,"<img style=\"background-repeat: no-repeat; background-size: 100% 100%; vertical-align: -0.838ex;height: 2.843ex; \" src=\"");
text = text.replace(/<meta class="mwe-math-fallback-image-display" aria-hidden="true" style="background-image: url\(/ ,"<img style=\"background-repeat: no-repeat; background-size: 100% 100%; vertical-align: -0.838ex;height: 2.843ex; \" src=\"");
text = text.replace(/&mode=mathml\"/ , "&mode=mathml>\"");
text = styling + text;
}
console.log(text); // after strip :p .
webview.loadHtml(text);
}
};
http.open('GET',p_url);
http.send();
}